<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<link rel="stylesheet" type="text/css" href="css/base.css" />
	<base href="<%=basePath%>">

	<title>Administrar Aviones</title>
	
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

</head>
  
<body>
	<f:view>
		<h:form>
			<h:commandLink action="terminarAdmin" value="Terminar" immediate="true"/>
			<hr>
			
			<h1>Listado de Aviones</h1>
			<h:dataTable binding="#{administrarAvionesBean.dataTable}" border="1" id="aviones" value="#{administrarAvionesBean.aviones}" var="fila">
				<h:column>
					<h:outputText id="marca" value="#{fila.marca}"></h:outputText>
					<f:facet name="header">
						<h:outputText value="Marca"></h:outputText>
					</f:facet>
				</h:column>
				<h:column>
					<h:outputText id="modelo" value="#{fila.modelo}"></h:outputText>
					<f:facet name="header">
						<h:outputText value="Modelo"></h:outputText>
					</f:facet>
				</h:column>
				<h:column>
					<h:outputText id="velocidad" value="#{fila.velocidad}"></h:outputText>
					<f:facet name="header">
						<h:outputText value="Velocidad"></h:outputText>
					</f:facet>
				</h:column>
				<h:column>
					<h:outputText id="categoria" value="#{fila.categoriaAvion}"></h:outputText>
					<f:facet name="header">
						<h:outputText value="Categoria"></h:outputText>
					</f:facet>
				</h:column>
				
				<h:column>
					<h:commandButton action="#{administrarAvionesBean.editar}" value="Editar"/>
				</h:column>
			</h:dataTable>
			<br>
			<h:commandButton action="#{administrarAvionesBean.crear}" value="Agregar Avion"/>
		</h:form>
	</f:view>
</body>
</html>